from common import Base
from sqlalchemy import Column, Integer, String, Float


# 定义模型类
class User(Base):
    __tablename__ = 'users'
    id = Column(Integer, primary_key=True)
    name = Column(String(255))
    age = Column(Integer)



class City(Base):
    __tablename__ = 'city'
    ID = Column(Integer, primary_key=True)
    Name = Column(String(35))
    CountryCode = Column(String(3))
    District = Column(String(20))
    Population = Column(Integer)

class Country(Base):
    __tablename__ = 'country'
    Code = Column(String(3), primary_key=True)
    Name = Column(String(52))
    Continent = Column(String(20))
    Region = Column(String(26))
    SurfaceArea = Column(Float(10, 2))
    IndepYear = Column(Integer)
    Population = Column(Integer)
    LifeExpectancy = Column(Float(3, 1))
    GNP = Column(Float(10, 2))
    GNPold = Column(Float(10, 2))
    LocalName = Column(String(45))
    HeadOfState = Column(String(60))
    Code2 = Column(String(2))
    GovernmentForm = Column(String(45))
    Capital = Column(Integer)


class CountryLanguage(Base):
    __tablename__ = 'countrylanguage'
    CountryCode = Column(String(3), primary_key=True)
    Language = Column(String(30), primary_key=True)
    IsOfficial = Column(String(3))
    Percentage = Column(Float(4, 1))
